﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VkSample410
{
    public class CircleData
    {
        public uint VCount { get; set; }

        public float[] Data { get; set; }

        public uint[] Index { get; set; }

        public void GenVertexData()
        {
            uint n = 10;
            VCount = n + 2;
            Data = new float[VCount * 6];
            float angdegSpan = 360.0f / n;
            int count = 0;
            Data[count++] = 0;
            Data[count++] = 0;
            Data[count++] = 0;
            Data[count++] = 1;
            Data[count++] = 1;
            Data[count++] = 1;
            for(float angdeg = 0; MathF.Ceiling(angdeg) <= 360.0f; angdeg += angdegSpan)
            {
                float angrad = angdeg / 180.0f * MathF.PI;
                Data[count++] = -30.0f * MathF.Sin(angrad);
                Data[count++] = 30.0f * MathF.Cos(angrad);
                Data[count++] = 0;
                Data[count++] = 0;
                Data[count++] = 1;
                Data[count++] = 0;
            }
            Index = new uint[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1 };
        }
    }
}
